/**
 * @file: proc.h
 * @author: yumeng (imyumeng@qq.com)
 * @brief:
 * @version 0.1
 * @date: 2021-09-05
 *
 * @copyright Meng_Yu Copyright (c) 2021
 *
 * @history: init first version. 2021-09-05
 */
#ifndef _PROC_H_
#define _PROC_H_

#include <windows.h>

#define INI_NAME 			".\\FPGACtrl2.ini"

#define INI_SEC_1 			"Setup"
#define INI_SEC_1_1 		"Speed"


#define INI_SEC_2 			"FPGA"
#define INI_SEC_3 			"PC"
#define INI_SEC_X_1 		"ON"
#define INI_SEC_X_2 		"OFF"


#define STR_LEN 128
#define COM_NUM 16
#define ARR_NUM 2

//#define DEBUG_EN

typedef struct 
{
	char open_str[STR_LEN];
	char close_str[STR_LEN];
} slot_t;
struct proc_data
{
	unsigned int idx;
	unsigned int speed;
	unsigned int open_flg;
	char port[COM_NUM][16];
	slot_t slot[ARR_NUM];
};

extern struct proc_data g_data;
extern int Read_Tnifile(void);
extern int Write_Tnifile(void);
extern void AppendEdit(HWND hWnd, int edit_idc, const char *str, ...);

#ifdef DEBUG_EN
extern void InitConsoleWindow(void);
extern void PrintError(unsigned int dwErrcode);
#endif

#endif /* _PROC_H_ */
